package IC.AST.SemanticAnalysis;

import IC.AST.*;

public class SemanticAnalysis
{
	public static void DoSemanticAnalysis(Program rootNode)
	{
		rootNode.Visit(new GlobalScopeCreatorVisitor());
		rootNode.RunOnTree(new TrivialTypeVisitor(rootNode.GetSymbolTable()));
		rootNode.Visit(new FillClassTablesVisitor());
		rootNode.Visit(new CheckOneMainVisitor());
		rootNode.Visit(new SetAllTypesVisitor());
		rootNode.RunOnTree(new TypeCheckVisitor());
		rootNode.Visit(new CheckBreakContinueVisitor());
		rootNode.Visit(new CheckReturnVisitor());
	}
}
